<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="x-ua-compatible" content="ie=7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员售后修改页 - ${web.name}${web.additionalTitle!}</title>
<link href="${root}/u/css/global.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/layout.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/memeber.css" type="text/css" rel="stylesheet" />
<link href="${sysResRoot}/front.css" rel="stylesheet" type="text/css"/>
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
	$("#jvForm").validate();
});
function g(o){
	return document.getElementById(o);
}
var picIndex = 1;
var picTpl = $.format($("#picTable").val());
function addPicLine() {
	$('#picBefore').before(picTpl(picIndex++));
}

function changeDemand(typeId){
	$.post('${base}/aftersale/demandlist.jspx',{
		'typeId':typeId
		}, function(data){
			if(data.success){
                var ss="";
                ss+=" <select id='demandId' name='demandId' onchange='changeRefundMoney(this.value);' class='required'>";
                ss+=" <option value=''>--请选择--</option>";
                for(var i=0;i<data.ids.length;i++){
                   ss+=" <option value='"+data.ids[i]+"'>"+data.names[i]+"</option>";
                }
                ss+="</select>";
                $("#demand").html("");
                $("#demand").html(ss);
			}
	   },'json');
}

function changeRefundMoney(demandId){
	$.post('${base}/aftersale/demandRefundMoney.jspx',{
		'demandId':demandId
		}, function(data){
			if(data.success){
             g("refund").style.display="";
			}else{
				 g("refund").style.display="none";
				 $("#refundmoney").val("0.0");
			}
	   },'json');
}
</script>
</head>

<body>
[#include "../include/页头顶栏.html"/]
<div id="head">
	[#include "../include/页头搜索栏.html"/]
    [#include "../include/页头导航栏.html"/]
</div>
[#include "../common/image_upload.html"/]
<div class="center mt10">
	 <div class="column_title"><span>用户登录</span></div>
     <div>
     <form id="jvForm" action="update.jspx" method="post">
         <div class="login_box_left">
              <div class="login">
                   <table width="100%" border="0" cellspacing="2" cellpadding="0">
                     <tr>
                            <td height="55" width="120" align="right" style="font-size:14px;"><font color="red">*</font>售后服务类型：</td>
                            <td height="55" width="205">
                               <select id="typeId" name="typeId" onchange="changeDemand(this.value);" class="required">
                                 [#list tlist as type]
                                   <option value="${type.id}" [#if type.id==aftersale.type.id]selected[/#if]>${type.name!}</option>
                                 [/#list]
                               </select>
                            </td>
                     </tr>
                      <tr>
                            <td height="55" width="120" align="right" style="font-size:14px;"><font color="red">*</font>售后服务要求：</td>
                            <td height="55" width="205">
                               <div id="demand">
                               <select id="demandId" name="demandId" onchange="changeRefundMoney(this.value);" class="required">
                                 [#list dlist as demand]
                                   <option value="${demand.id}" [#if demand.id==aftersale.demand.id]selected[/#if]>${demand.name!}</option>
                                 [/#list]
                               </select>
                               </div>
                            </td>
                     </tr>
                     
                     <tr id="refund" [#if !aftersale.demand.isRefund]style="display: none;"[/#if]>
                            <td height="55" width="120" align="right" style="font-size:14px;">退款金额：</td>
                            <td height="55" width="205"><input type="text" id="refundmoney" name="refundmoney"  value="${aftersale.refundmoney!0.0}"/>
                            </td>
                     </tr>
                     <tr>
                         <td height="55" width="120" align="right" style="font-size:14px;">补充留言：</td>
                         <td height="55" width="205"><textarea name="additionalwords" cols="50" rows="5">${aftersale.additionalwords!}</textarea></td>
                     </tr>
                    [#if aftersale.status==3]
                     <tr>
                         <td height="55" width="120" align="right" style="font-size:14px;">平台商是否介入：</td>
                         <td height="55" width="205">
                         <input type="radio" name="intervene" value="true"/>是&nbsp;&nbsp;
                          <input type="radio" name="intervene" value="false" checked="checked"/>否
                         </td>
                     </tr>
                     [/#if]
                     <tr>
                            <td height="55" width="120" align="right" style="font-size:14px;">上传凭证：</td>
                            <td height="55" width="205">
                              <table border="0" style="float:left">
                               <tr><td align="left"> 
                                             <input type="button" value="增加款式" onclick="addPicLine()"/>
                                       </td>
                               </tr>
                               <tr><td align="left"> 
                              [#list aftersale.pictures as pic]
                                  <table id="picTable${pic_index+1}" border="0" style="float: left;">
                                      <tr>
			                             <td align="center"><div>
			                                <a href="javascript:void(0);" onclick="$('#picTable${pic_index+1}').remove();" class="pn-opt">删除</a>
		    	                            <img id="preImg${pic_index+1}" alt="预览" src="${uploadRoot!}${pic.picturePath!}"  style="width:90px;height:90px;background-color:#ccc;border:1px solid #333"/>
				                             <input type="text" id="uploadImgPath${pic_index+1}" name="fashionPic" value="${pic.picturePath!}" style="width: 160px" /></div>
		                                      <div><span id="ufc${pic_index+1}">
		                                        <input type="file" id="uploadFile${pic_index+1}" size="10" style="width: 150px" /></span> 
					                           <input type="button" value="上传" onclick="upload(${pic_index+1});"/></div>
			                               </td>
		                               </tr>
                                    </table>
                                    [/#list]
                                    <div id="picBefore" style="clear:both"></div>
                                    </td>
                                 </tr>
                               </table>
                           </td>
                         </tr>
                          <tr>
                            <td height="55" width="120" align="right">
                            <input type="hidden" name="id" value="${aftersale.id}"/>
                            <input type="hidden" name="orderId" value="${order.id}"/></td>
                            <td height="55" width="205"><input type="submit" value="提交申请"  class="login_button"/></td>
                     </tr>
                   </table>
              </div>
          </div>
          <textarea id="picTable" style="display: none;">
<table id="picTable{0}" border="0" style="float: left;">
<tr>
	<td align="center">
      <div>
       <a href="javascript:void(0);" onclick="$('#picTable{0}').remove();" class="pn-opt">删除</a>
	   <img id="preImg{0}" noResize="true" style="overflow:hidden;width:90px;height:90px;background-color:#ccc;border:1px solid #333"/>
		<input type="text" id="uploadImgPath{0}" name="fashionPic" style="width: 160px" class="required"/>
		 <a href="javascript:void(0);" onclick="$('#picTable{0}').remove();" class="pn-opt"></a></div>
	    <div><span id="ufc{0}"><input type="file" id="uploadFile{0}" size="10" style="width: 150px" /></span> 
		     <input type="button" value="上传" onclick="upload({0});"/></div>
	  </td>
</tr>
</table>
</textarea>
       </form>   
       	 <script type="text/javascript">
       	var picIndex = ${aftersale.pictures?size}+1;
	  var picTpl = $.format($("#picTable").val());
	   function addPicLine() {
		$('#picBefore').before(picTpl(picIndex++));
	   }
     </script>
        <div class="line"></div>
          <div class="login_zc">
          	 <table width="100%" border="0" cellspacing="2" cellpadding="0">
               <tr>
                  <td height="55" width="325" align="left" colspan="2"><h5>宝贝信息</h5></td>
              </tr>
              [#list order.items as item]
               <tr>
                  <td height="55" width="70" align="right"><img src="${root}/${item.product.coverImg!}" width="50" height="50"/></td>
                  <td height="55" width="255">[@text_cut s=item.product.name len='10' append='...'/]</td>
              </tr>
              [/#list]
               <tr>
                  <td height="55" width="70" align="right">卖家:</td>
                  <td height="55" width="255">${order.store.storeName!}</td>
              </tr>
              <tr>
                  <td height="55" width="325" align="right" colspan="2">
                  <a class="aBlu" href="../order/myOrderView.jspx?orderId=${order.id}" target="_blank">查看订单详情>></a></td>
              </tr>
            </table>
          </div>
          <div class="clear"></div>
     </div>
</div>
[#include "../include/页脚信息栏.html"/]
</body>
</html>
